\hypertarget{classduye_1_1_socket}{\section{duye\-:\-:Socket Class Reference}
\label{classduye_1_1_socket}\index{duye\-::\-Socket@{duye\-::\-Socket}}
}


server socket class  




{\ttfamily \#include $<$duye\-\_\-socket.\-h$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \hyperlink{classduye_1_1_socket_aa20e47cfe84bab0d0ad71efbc621b708}{open} (const Net\-Protocol \&protocol, const bool is\-Block=true)
\begin{DoxyCompactList}\small\item\em open socket \end{DoxyCompactList}\item 
\hypertarget{classduye_1_1_socket_a4617e822e28c74457e49217d5e4b5df6}{bool {\bfseries open} (const Net\-Protocol \&protocol, const std\-::string \&if\-Name, const bool is\-Block=true)}\label{classduye_1_1_socket_a4617e822e28c74457e49217d5e4b5df6}

\item 
\hypertarget{classduye_1_1_socket_afd4ea0eb5ca7d5f8db07af6b9ef7bad6}{bool {\bfseries is\-Open} () const }\label{classduye_1_1_socket_afd4ea0eb5ca7d5f8db07af6b9ef7bad6}

\item 
bool \hyperlink{classduye_1_1_socket_affe33679ec4192538d937be35ebd252d}{close} (const int32 how=2)
\begin{DoxyCompactList}\small\item\em shutdown connecting \end{DoxyCompactList}\item 
int32 \hyperlink{classduye_1_1_socket_a9ccffaee3432e9f426511aedee04a506}{sockfd} () const 
\begin{DoxyCompactList}\small\item\em get sock fd \end{DoxyCompactList}\item 
uint8 $\ast$ \hyperlink{classduye_1_1_socket_ab5d40002de30fe1e6e1fc1406d81f656}{error} ()
\begin{DoxyCompactList}\small\item\em get last error string \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
server socket class 

\subsection{Member Function Documentation}
\hypertarget{classduye_1_1_socket_affe33679ec4192538d937be35ebd252d}{\index{duye\-::\-Socket@{duye\-::\-Socket}!close@{close}}
\index{close@{close}!duye::Socket@{duye\-::\-Socket}}
\subsubsection[{close}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Socket\-::close (
\begin{DoxyParamCaption}
\item[{const int32}]{how = {\ttfamily 2}}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_socket_affe33679ec4192538d937be35ebd252d}


shutdown connecting 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em how} & \-: default is 2 \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
how = 0 \-: stop receive data how = 1 \-: stop send data how = 2 \-: both above way 
\end{DoxyNote}
\hypertarget{classduye_1_1_socket_ab5d40002de30fe1e6e1fc1406d81f656}{\index{duye\-::\-Socket@{duye\-::\-Socket}!error@{error}}
\index{error@{error}!duye::Socket@{duye\-::\-Socket}}
\subsubsection[{error}]{\setlength{\rightskip}{0pt plus 5cm}uint8$\ast$ duye\-::\-Socket\-::error (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_socket_ab5d40002de30fe1e6e1fc1406d81f656}


get last error string 

\begin{DoxyReturn}{Returns}
error string 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_socket_aa20e47cfe84bab0d0ad71efbc621b708}{\index{duye\-::\-Socket@{duye\-::\-Socket}!open@{open}}
\index{open@{open}!duye::Socket@{duye\-::\-Socket}}
\subsubsection[{open}]{\setlength{\rightskip}{0pt plus 5cm}bool duye\-::\-Socket\-::open (
\begin{DoxyParamCaption}
\item[{const Net\-Protocol \&}]{protocol, }
\item[{const bool}]{is\-Block = {\ttfamily true}}
\end{DoxyParamCaption}
)}}\label{classduye_1_1_socket_aa20e47cfe84bab0d0ad71efbc621b708}


open socket 


\begin{DoxyParams}[1]{Parameters}
\mbox{\tt in}  & {\em protocol} & \-: network protocol \\
\hline
\mbox{\tt in}  & {\em if\-Name} & \-: interface name \\
\hline
\mbox{\tt in}  & {\em is\-Block} & \-: block/unblock, default is block \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true/false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}

\end{DoxyNote}
\hypertarget{classduye_1_1_socket_a9ccffaee3432e9f426511aedee04a506}{\index{duye\-::\-Socket@{duye\-::\-Socket}!sockfd@{sockfd}}
\index{sockfd@{sockfd}!duye::Socket@{duye\-::\-Socket}}
\subsubsection[{sockfd}]{\setlength{\rightskip}{0pt plus 5cm}int32 duye\-::\-Socket\-::sockfd (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
) const}}\label{classduye_1_1_socket_a9ccffaee3432e9f426511aedee04a506}


get sock fd 

\begin{DoxyReturn}{Returns}
sock fd 
\end{DoxyReturn}


The documentation for this class was generated from the following file\-:\begin{DoxyCompactItemize}
\item 
Z\-:/duye/src/duyebase/system/\hyperlink{duye__socket_8h}{duye\-\_\-socket.\-h}\end{DoxyCompactItemize}
